package com.lhl.jwt.domain.entity;

import com.lhl.fw.db.entity.AbstractAuditEntity;
import com.lhl.jwt.domain.bo.WxExtBO;
import com.vladmihalcea.hibernate.type.json.JsonStringType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @description: 用户数据
 * @author: king
 * @date: 2020-11-09
 **/
@Api(tags = "用户数据", produces = "用户数据")
@Table(name = "SYS_USER")
@Entity
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@TypeDef(name = "json", typeClass = JsonStringType.class)
public class SysUser extends AbstractAuditEntity<String> {

    @ApiModelProperty(value = "用户名", example = "king")
    @Column(name = "USER_NAME",length = 20)
    private String username;
    @ApiModelProperty(value = "密码", example = "***")
    @Column(name = "PASS_WORD",length = 200)
    private String password;
    @ApiModelProperty(value = "图像路径", example = "http://")
    @Column(name = "FACE_IMAGE",length = 200)
    private String faceImage;
    @ApiModelProperty(value = "角色", example = "admin")
    @Column(name = "ROLE",length = 200)
    private String role;
    @ApiModelProperty(value = "微信ID", example = "xxx")
    @Column(name = "OPEN_ID",length = 28)
    private String openId;
    @ApiModelProperty(value = "手机号码", example = "158***78987")
    @Column(name = "MOBILE",length = 11)
    private String mobile;
    @ApiModelProperty(value = "微信扩展字段")
    @Type(type = "json")
    @Column(name = "WX_EXT", columnDefinition = "json")
    private WxExtBO wxExtBO;
}
